<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			img {
				position: absolute;
			}
		</style>
	</head>

	<body>
		<img src="images/angel.gif" alt="">
		<script type="text/javascript">
			var pic = document.querySelector("img");
			document.addEventListener("mousemove", function(e) {
				//千万别忘记添加px单位
				pic.style.left = (e.pageX - 40) + "px";
				pic.style.top = (e.pageY - 40) + "px";
			})
		</script>
	</body>
</html>
